import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

  const routes = [
  {
    path: '/',
    name: 'Home',
    component:()=>import('../views/Home.vue'),
    children:[
          {
          path:'admin',
          name:'Admin',
          component:()=>import('../components/Home/Admin.vue'),
         
        },
        {
          path:'changeadmin/:_id',
          component:()=>import('../components/Home/Changeadmin.vue')

        },
        {
          path:'order',
          name:'Order',
          component:()=>import('../components/Home/Order.vue')
        },
        {
          path:'car',
          name:'Car',
          component:()=>import('../components/Home/car/car.vue')
        },
        {
          path:'user',
          name:'user',
          component:()=>import('../components/Home/user.vue')
        },
        {
          path:'userCheck',
          name:'userCheck',
          component:()=>import('../components/Home/userCheck.vue')
        },
        {
          path:'comments',
          name:'comments',
          component:()=>import('../components/Home/Comments.vue')
        },
        {
          path:'statistics',
          name:'statistics',
          component:() => import('../components/Home/Statistics.vue')
        }
    ]
  },
  {
    path: '/login',
    name: 'Login',
   
    component: () => import('../views/Login.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
